home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15167 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.os.qnx,comp.lang.c++,comp.lang.c
  4. Subject: Re: struct stat.st_type in Watcom C/C++ v9.5 for QNX
  5. Followup-To: comp.os.qnx,comp.unix.programmer
  6. Date: Wed, 03 Apr 96 23:19:02 GMT
  7. Organization: none
  8. Message-ID: <828573542snz@genesis.demon.co.uk>
  9. References: <3161791B.5D8F@ia.pw.edu.pl>
  10. Reply-To: fred@genesis.demon.co.uk
  11. X-NNTP-Posting-Host: genesis.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.27
  13. X-Mail2News-Path: genesis.demon.co.uk
  14.  
  15. In article <3161791B.5D8F@ia.pw.edu.pl> brudka@ia.pw.edu.pl "A. Pacut" writes:
  16.  
  17. >Hi,
  18. >According to the "WATCOM C LIBRARY REFERENCE FOR QNX" the structure stat
  19. >in sys/stat.h should contain the field _ftype_t st_type that allows to
  20. >identify the type of given file i.e if it is fifo, regular, directory
  21. >etc. Unfortunatelly there is no st_type in this structure. Moreover
  22. >there is no field of _ftype_t in the structure stat that makes me able
  23. >to recognize the file (althought the field st_spare0 is the appropriate
  24. >type, its values are usually useless). Could anybody tell me then what
  25. >is the way of checking the type of a file?
  26.  
  27. Standard C doesn't support file types and doesn't define a struct stat.
  28. POSIX does and the information is held in the st_mode member. POSIX also
  29. defines S_ISDIR(), S_ISCHR(), S_ISBLK(), S_ISREG(), S_ISFIFO() macros
  30. for testing an st_mode value.
  31.  
  32. I've removed comp.lang.c and comp.lang.c++ from the followups and added
  33. comp.unix.programmer.
  34.  
  35. -- 
  36. -----------------------------------------
  37. Lawrence Kirby | fred@genesis.demon.co.uk
  38. Wilts, England | 70734.126@compuserve.com
  39. -----------------------------------------
  40.